package com.azt.provider.mapper;

import com.azt.api.pojo.Role;
import com.azt.api.pojo.UserRole;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface UserRoleMapper extends Mapper<UserRole> {

	UserRole getUserRoleById(Integer id);

	UserRole getUserRoleByRoleId(@Param("roleId")Integer roleId, @Param("userId")Integer userId);

	List<UserRole> getUserRolesByRoleId(Integer roleId);

	List<UserRole> getUserRoleByAdmin(@Param("companyId")Integer companyId, @Param("AdminRole")List<Role> ifAdminRole);

	int hasThisPerm(@Param("roleId") int roleId, @Param("codes") String[] codes, @Param("type") int type);
}